import {NgModule} from '@angular/core';
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {RouterModule, Routes} from "@angular/router";
import {
  AdministratorListComponent,
  AdministratorModule, LayoutManageComponent, LayoutManageModule, LayoutRootComponent,
  LoginComponent as ManageLoginComponent,
  LoginModule as ManageLoginModule,
  RoleListComponent as ManageRoleListComponent, RoleModule as ManageRoleModule
} from "geminis-ng-manage";
import {OrganizationListComponent} from "../../projects/geminis-ng-resources/src/organization/list/organization-list.component";
import {OrganizationModule} from "../../projects/geminis-ng-resources/src/organization/organization.module";
import {RoleListComponent as ResourcesRoleListComponent} from "../../projects/geminis-ng-resources/src/role/list/role-list.component";
import {RoleModule as ResourcesRoleModule} from "../../projects/geminis-ng-resources/src/role/role.module";
import {UserListComponent} from "../../projects/geminis-ng-resources/src/user/list/user-list.component";
import {UserModule} from "../../projects/geminis-ng-resources/src/user/user.module";
import {LoginModule as UserLoginModule} from "../../projects/geminis-ng-resources/src/login/login.module";
import {LoginComponent as UserLoginComponent} from "../../projects/geminis-ng-resources/src/login/login.component";
import {LayoutResourcesComponent} from "../../projects/geminis-ng-resources/src/layout/manage/layout-resources.component";
import {LayoutResourcesModule} from "../../projects/geminis-ng-resources/src/layout/layout-resources.module";

const routes: Routes = [
  {path: '', component: UserLoginComponent},
  {path: 'manageLogin', component: ManageLoginComponent},
  {
    path: 'resources', component: LayoutResourcesComponent, children: [
      {path: 'organization', component: OrganizationListComponent},
      {path: 'user', component: UserListComponent},
      {path: 'role', component: ResourcesRoleListComponent},
    ]
  },
  {
    path: 'manage', component: LayoutManageComponent, children: [
      {path: 'administrator', component: AdministratorListComponent},
      {path: 'role', component: ManageRoleListComponent}
    ]
  }
];

@NgModule({
  declarations: [],
  imports: [
    RouterModule.forRoot(routes),
    UserLoginModule,

    BrowserAnimationsModule,
    LayoutManageModule,
    ManageLoginModule,
    AdministratorModule,
    ManageRoleModule,

    OrganizationModule,
    UserModule,
    ResourcesRoleModule,
    LayoutResourcesModule

  ],
  providers: [],
  bootstrap: [LayoutRootComponent]
})
export class AppModule {
}
